package com.yazi.mxz.person.data.form.shop;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotEmpty;

import com.yazi.mxz.common.entity.beans.SpecType;
import com.yazi.mxz.person.data.form.Form;

/**
 * 表单对象－商品规格类型
 *
 * @author mo_yq5
 * @since 2016年6月1日
 */
public class SpecTypeForm extends Form<SpecType> {

	/**
	 * 表单类型－商品规格类型－编辑
	 */
	public interface Edit {
	}

	/**
	 * 表单类型－商品规格类型－添加
	 */
	public interface Add {
	}

	public SpecTypeForm() {
		super(new SpecType());
	}

	private Long specTypeId; // ID
	private String name; // 名称
	private StoreGoodsForm storeGoods;// 店铺商品

	@NotNull(groups = {Edit.class, SpecForm.Add.class})
	public Long getSpecTypeId() {
		return specTypeId;
	}

	public void setSpecTypeId(Long specTypeId) {
		get().setSpecTypeId(specTypeId);
		this.specTypeId = specTypeId;
	}

	@NotEmpty(message = "规格类型名称不能为空")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		get().setName(name);
		this.name = name;
	}

	@NotNull(groups = Add.class)
	public StoreGoodsForm getStoreGoods() {
		return storeGoods;
	}

	public void setStoreGoods(StoreGoodsForm storeGoods) {
		get().setStoreGoods(storeGoods.get());
		this.storeGoods = storeGoods;
	}

}
